﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="XMLDataSourceDemo.aspx.cs"
    Inherits="AspNetTrainingClasses.dataControls.XMLDataSourceDemo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="XmlDataSourceStudents">
            <Columns>
                <asp:BoundField DataField="id" HeaderText="id" SortExpression="id" />
            </Columns>
        </asp:GridView>
        <asp:XmlDataSource ID="XmlDataSourceStudents" runat="server" DataFile="~/dataControls/Products.xml"
            XPath="products/product"></asp:XmlDataSource>
        <asp:Repeater ID="rptXML" runat="server" DataSourceID="XmlDataSourceStudents">
            <ItemTemplate>
                <%#XPath("@id") %>
                <%#XPath("name") %><br />
                <asp:Repeater ID="rptInner" runat="server" DataSource='<%#XPathSelect("order") %>'>
                    <ItemTemplate>
                        <%#XPath("id") %>
                    </ItemTemplate>
                </asp:Repeater>
            </ItemTemplate>
        </asp:Repeater>
        <asp:TreeView ID="tvProducts" runat="server" 
            DataSourceID="XmlDataSourceStudents"   SelectedNodeStyle-BackColor="Green"
           AutoGenerateDataBindings="true" >
           
        </asp:TreeView>
    </div>
    </form>
</body>
</html>
